#include "dwgcircle.h"

DwgCircle::DwgCircle() : mRadius(50)  // 默认半径为50
{
    mType = DCircle;
}

void DwgCircle::setCenter(const QPoint &center)
{
    mCenterPt = center;
}

void DwgCircle::setRadius(int radius)
{
    mRadius = radius;
}

void DwgCircle::Draw(QPainter *p)
{
    QRect circleRect(mCenterPt.x() - mRadius, mCenterPt.y() - mRadius,
                     mRadius * 2, mRadius * 2);
    p->drawEllipse(circleRect);
}
